//
//  MNDAwardRulesAlertViewController.m
//  minidai
//
//  Created by Vitas on 2018/9/2.
//  Copyright © 2018年 迷你贷. All rights reserved.
//

#import "MNDAwardRulesAlertViewController.h"

@interface MNDAwardRulesAlertViewController ()

@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UIView *alertView;
@property (weak, nonatomic) IBOutlet UILabel *tipLabel;


@end

@implementation MNDAwardRulesAlertViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.alertView.transform = CGAffineTransformMakeScale(0.8, 0.8);
    UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(dismissAction:)];
    [self.view addGestureRecognizer:tapGesture];
    
    if (self.titleStr) {
        self.titleLabel.text = self.titleStr;
    }
    if (self.tipStr) {
        self.tipLabel.text = self.tipStr;
    }
   
    // Do any additional setup after loading the view.
}

- (void)viewWillAppear:(BOOL)animated {
    
    [super viewWillAppear:animated];
    
    [UIView animateWithDuration:0.7
                          delay:0.0
         usingSpringWithDamping:0.5
          initialSpringVelocity:0.1
                        options:UIViewAnimationOptionCurveEaseIn
                     animations:^{
                         
                         self.alertView.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1.0, 1.0);
                     }
                     completion:^(BOOL finished) {
                         
                     }];
    
}

- (void)dismissAction:(UITapGestureRecognizer *)gesture {
    [self dismissAlertView];
}

//我知道了
- (IBAction)iknowAction:(UIButton *)sender {
    [self dismissAlertView];
}

- (void)dismissAlertView{
    [self.view removeFromSuperview];
    [self removeFromParentViewController];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
